package ee.subjects.frontend.controller.command.employeeCommands;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import ee.subjects.backend.model.data.Enterprise;
import ee.subjects.backend.model.data.Subject_attribute;
import ee.subjects.backend.services.EnterpriseService;
import ee.subjects.backend.services.EnterpriseServiceImpl;
import ee.subjects.frontend.controller.command.Command;

public class EnterpriseListForEmployees implements Command {

	@Override
	public int execute(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		
		EnterpriseService enterpriseService = new EnterpriseServiceImpl();
		List<Enterprise> enterprisesList =enterpriseService.getAllEnterprises();
		
		request.setAttribute ("EnterprisesList", enterprisesList);
		
		return 1;
	}

}
